﻿//====================================================================
// Create by Daniel
// file： YCModuleArtical.cs
// project ：YunCMS
// Build time：2012-09-08
// modify:
// description:
// ===================================================================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

using YunCMS.BLL;
using YunCMS.Model;

public partial class YCModuleArticalManage : System.Web.UI.Page
{
    private const int PAGE_SIZE = 10;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
        	
		}
    }
    

   	protected void saveBt_Click(object sender, EventArgs e)
    {
		YCModuleArticalBLL bll = new YCModuleArticalBLL();
		YCModuleArtical model = new YCModuleArtical();
			model.Title = TitleTB.Text.Trim();
			model.Keywords = KeywordsTB.Text.Trim();
			model.Summary = SummaryTB.Text.Trim();
			model.Content = ContentTB.Text.Trim();
			model.Author = AuthorTB.Text.Trim();
			model.Description = DescriptionTB.Text.Trim();
			if(CategoryIDTB.Text.Trim()!="")
	model.CategoryID = System.Convert.ToInt32(CategoryIDTB.Text.Trim());
	else
	model.CategoryID = 0;
			model.IsHomePage = System.Convert.ToBoolean(IsHomePageRB.SelectedValue);
			if(AddTimeTB.Text.Trim()!="")
	model.AddTime = System.Convert.ToDateTime(AddTimeTB.Text.Trim());
	else
	model.AddTime = System.Convert.ToDateTime("0001-1-1");
			if(UpdateTimeTB.Text.Trim()!="")
	model.UpdateTime = System.Convert.ToDateTime(UpdateTimeTB.Text.Trim());
	else
	model.UpdateTime = System.Convert.ToDateTime("0001-1-1");
			if(AccessTB.Text.Trim()!="")
	model.Access = System.Convert.ToInt32(AccessTB.Text.Trim());
	else
	model.Access = 0;
			if(HitsTB.Text.Trim()!="")
	model.Hits = System.Convert.ToInt32(HitsTB.Text.Trim());
	else
	model.Hits = 0;
			model.Editor = EditorTB.Text.Trim();
			model.IsPopular = System.Convert.ToBoolean(IsPopularRB.SelectedValue);
			model.ImageUrl = ImageUrlTB.Text.Trim();
			model.LinkUrl = LinkUrlTB.Text.Trim();
			model.Source = SourceTB.Text.Trim();
			if(DiggTopTB.Text.Trim()!="")
	model.DiggTop = System.Convert.ToInt32(DiggTopTB.Text.Trim());
	else
	model.DiggTop = 0;
			if(DiggStepTB.Text.Trim()!="")
	model.DiggStep = System.Convert.ToInt32(DiggStepTB.Text.Trim());
	else
	model.DiggStep = 0;
			model.Active = System.Convert.ToBoolean(ActiveRB.SelectedValue);
			model.Lang = LangTB.Text.Trim();
		bll.Add(model);
		Response.Redirect("YCModuleArtical.aspx");
    }
    protected void cancelBt_Click(object sender, EventArgs e)
    {
		Response.Redirect("YCModuleArtical.aspx");
    }
}




